<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>微会员申请</title>
<meta name="decorator" content="default" />
<meta name="viewport"
	content="width=device-width initial-scale=1.0  maximum-scale=1.0">
<jsp:include page="/static/member/themes/default/header.jsp" />

<script type="text/javascript">
	$(document).ready(function() {
		document.title = "微会员申请";
		$("#errorMessage").hide()
	});
	function checkForm(){
		
		var tel = $.trim($('#mobile').val());
		var nick = $.trim($('#nickName').val());
		
		
		if(nick == null || nick ==''){
			$("#errorMessage").html("请输入姓名");
			$("#errorMessage").show()
			return false;
		}else{
			$("#errorMessage").hide();
		}
		
		
		
		if(tel == null || tel ==''){
			$("#errorMessage").html("请输入手机");
			$("#errorMessage").show()
			return false;
		}else{
			if(/^1[3,4,5,8]\d{9}$/g.test(tel)||(/^15[8,9]\d{8}$/g.test(tel))){
				$("#errorMessage").hide();
				
			}else{
				$("#errorMessage").html("手机号输入错误");
				$("#errorMessage").show()
				return false;
			}
		}
		
		
		
		return true;
	}
</script>

</head>
<body>

	<div class="main">
		<div>
			<div>
				<div class="ztContent">
					<div data-role="header" align="center" style="margin:10px;">
						<h3>微会员申请</h3>
					</div>
					<!-- /header -->
					<c:if test="${reg eq 'reg' }">
						<form id="inputForm" action="${ctx}/member/bind?uid=${uid}" method="post" onsubmit=" return checkForm();">
							<input type="hidden" name="action" value="reg" /> 
							<input	type="hidden" name="topage" value="${topage }" />
							<input	type="hidden" name="wechatId" value="${wechatId }" />
							<input	type="hidden" name="style" value="${style}"/>
							<div align="center">
								<div class="control-group">
									<div class="controls" >
										姓&nbsp;&nbsp;&nbsp;名:&nbsp;&nbsp;<input name="name"  type="text" id="nickName"
											maxlength="15" class="required input-medium"  style="height:26px;"/><span style="color:red">*</span>
									</div>
								</div>

								<div class="control-group">
									<div class="controls" >
										手&nbsp;&nbsp;&nbsp;机:&nbsp;&nbsp;<input name="mobile" id="mobile" type="text" 
											maxlength="11" class="required digits input-medium" style="height:26px;"/><span style="color:red">*</span>
									</div>
								</div>
								
								<c:if test="${ userDefine.recommendCode ne '0'}">
								
									<div class="control-group">
										<div class="controls" >
											暗&nbsp;&nbsp;&nbsp;号:&nbsp;&nbsp;<input   name="recommendCode" id="recommendCode" type="text" maxlength="10" class="required digits input-medium" style="height:26px;" />
										</div> 
									</div>
								</c:if>
								
								
								<div   align="center" class="alert">
										<span  style="color:red" >注意</span>:手机号将作为微信会员的唯一标记且一个微信号只能与一个手机号绑定，我们不会将您的任何信息泄露给任何第三方，请认真填写您的信息。<br/>
										暗号处填写您推荐人暗号,推荐成功后，您将有机会获得我们提供的奖品!
								</div>
									<div align="center" class="alert" id="errorMessage"
								style="color: red;"></div>
								<div   align="center">
									<input id="btnSubmit" class="btn btn-danger" type="submit"
										value="确 定" />
								</div>
							</div>
						</form>

					</c:if>
						<c:if test="${not empty message  }">
					<div  align="center" class="alert">
									<h4>${message }</h4>
									 <br>
									<h5 style="color:red">${regLottery}</h5>
					</div>
					</c:if>
				</div>
			</div>
		</div>
	</div>
	<c:if test="${uid ne '34' }">
		<jsp:include page="/static/member/themes/default/footer.jsp">
			<jsp:param value="${id }" name="uid"/>
		</jsp:include>
	</c:if>
</body>
</html>
